    <?php
	
	$dbconn = pg_connect("host=gegevensbanken.khleuven.be port=51314 dbname=probeer user=u0047590 password=LBK966lv");
	$result = pg_query($dbconn, "SELECT * FROM guesswords");
	$numrows = pg_numrows($result);
	
   // Loop on rows in the result set.

   for($ri = 0; $ri < $numrows; $ri++) {
    $row = pg_fetch_array($result, $ri);
	$output[]=$row;
   }
   
   print(json_encode($output));
	
	//check this: http://www.helloandroid.com/tutorials/connecting-mysql-database
	
	pg_close($dbconn);	
    ?>
